package com.atguigu.lease.common.springmvc;

import com.atguigu.lease.common.result.ResultCodeEnum;
import lombok.Data;

import java.rmi.dgc.Lease;


/**
 * 自定义异常类，后面需要配置到全局异常处理类中
 * @Param
 * @return
 */
@Data
public class LeaseException extends RuntimeException{

    private int code;

    public LeaseException(String message,int code){
        super(message);
        this.code = code;
    }

    public LeaseException(ResultCodeEnum resultCodeEnum){
        super(resultCodeEnum.getMessage());
        this.code = resultCodeEnum.getCode();
    }
}
